#ifndef PHONELOGINWIDGET_H
#define PHONELOGINWIDGET_H

#include <QWidget>
#include <QLineEdit>
#include <QPushButton>
#include <QLabel>

class PhoneLoginWidget : public QWidget
{
    Q_OBJECT
public:
    explicit PhoneLoginWidget(QWidget *parent = nullptr);
    //切换登录或者注册界面
    void switchMode();
    void clickSubmitBtn();
    void phoneLoginDone(bool ok, const QString &reason);
    void phoneRegisterDone(bool ok, const QString &reason);
    void sendVerifyCode();
    void countDown();
    void sendVerifyCodeDone();
private:
    bool isLoginMode = true;

    //输入手机号对话框
    QLineEdit* phoneEdit;
    //发送验证码按钮
    QPushButton* sendVerifyCodeBtn;
    //发送验证码框
    QLineEdit* verifyCodeEdit;
    //标题名字
    QLabel* titleLabel;
    //提交按钮（登录和注册）
    QPushButton* submitBtn;
    //切换登录注册模式
    QPushButton* switchModeBtn;


    QString currentPhone = "";    // 记录是使用哪个手机号发送的验证码
    QTimer* timer;
    int leftTime = 30;

signals:
};

#endif // PHONELOGINWIDGET_H
